﻿using YDT_PaymentService.Applictions.Interfaces;
using YDT_PaymentService.Applictions.Mappings;

namespace YDT_PaymentService.Applictions
{
    /// <summary>
    /// 应用层依赖注入配置
    /// </summary>
    public static class DependencyInjection
    {
        /// <summary>
        /// 添加应用层服务
        /// </summary>
        public static IServiceCollection AddApplication(this IServiceCollection services)
        {
            // 注册应用服务
            services.AddScoped<IPaymentService, Services.PaymentService>();

            // 注册AutoMapper
            services.AddAutoMapper(options => {
                options.AddProfile<MappingProfile>();
            });

            return services;
        }
    }
}
